﻿
////////////////////////////////////////////////////////////////////////////////////////////
// 文件名: SSConfigConnBLL.gen.cs
//
// 模块名称: SSConfigConnBll
//
// 作者: LPC
//
// 历史记录（记录修改记录，修改文件后请添加修改记录，注明修改时间、修改人，修改内容）:
// 13-1-29    LPC    创建文件
////////////////////////////////////////////////////////////////////////////////////////////

using System;
using System.Data;
using System.Data.Common;
using System.Text;
using Common;
using DAL;
using Model;

namespace BLL
{
    /// <summary>
    /// SSConfigConn表业务逻辑层
    /// </summary>
    public partial class SSConfigConnBLL  : BaseBLL
    {
        public SSConfigConnBLL(LoginInfo info)
        {
            loginInfo = info;
        }
        const string RightCodeInsert = "";    //添加权限编码
        const string RightCodeUpdate = "";    //修改权限编码
        const string RightCodeDelete = "";    //删除权限编码
        
        const string ErrorCodeSelect = "";    //查询异常编码
        const string ErrorCodeInsert = "";    //添加异常编码
        const string ErrorCodeUpdate = "";    //修改异常编码
        const string ErrorCodeDelete = "";    //删除异常编码
         
        /// <summary>
        /// 根据SSConfigID字段获取SSConfigConnInfo实体对象
        /// </summary>
        /// <param name="sSConfigID">SSConfigID</param>
        /// <returns>SSConfigConnInfo实体对象</returns>
        public SSConfigConnInfo GetInfoById (string sSConfigID)
        {
            try
            {
                return new SSConfigConnDAL(loginInfo).GetInfoById(sSConfigID);
            }
            catch(Exception ex)
            {
                Logger.LogError("SSConfigConnBLL", "GetInfo", AppError.EROR, 0, ex, "获取SSConfigConnBll信息出错。",
                                String.Format("sSConfigID = {0}", sSConfigID));
                throw new SystemException(ErrorCodeSelect, ex);
            }
        }
        
        /// <summary>
        /// 往SSConfigConn表内添加新记录
        /// </summary>
        /// <param name="SSConfigConnInfo">SSConfigConnInfo实体对象</param>
        /// <returns>添加记录索引值</returns>
        public int Insert(SSConfigConnInfo sSConfigConnInfo)
        {
            try
            {
                int identity = new SSConfigConnDAL(loginInfo).Insert(sSConfigConnInfo);
                return identity;
            }
            catch(Exception ex)
            {
                Logger.LogError("SSConfigConnBLL", "Insert", AppError.EROR, 0, ex, "添加SSConfigConnBll信息出错。", null);
                throw new SystemException(ErrorCodeInsert, ex);
            }
        }
        
        /// <summary>
        /// 更新SSConfigConn表记录
        /// </summary>
        /// <param name="SSConfigConnInfo">SSConfigConnInfo实体对象</param>
        public void Update(SSConfigConnInfo sSConfigConnInfo)
        {
            try
            {
                new SSConfigConnDAL(loginInfo).Update(sSConfigConnInfo);
            }
            catch(Exception ex)
            {
                Logger.LogError("SSConfigConnBLL", "Update", AppError.EROR, 0, ex, "更新SSConfigConnBll信息出错。", 
                                String.Format("SSConfigID = {0}", sSConfigConnInfo.SSConfigID));
                throw new SystemException(ErrorCodeUpdate, ex);
            }
        }
        
        /// <summary>
        /// 根据SSConfigID字段获取SSConfigConnInfo实体对象
        /// </summary>
        /// <param name="sSConfigID">SSConfigID</param>
        public void Delete(string sSConfigID)
        {
            try
            {
                new SSConfigConnDAL(loginInfo).Delete(sSConfigID);
            }
            catch(Exception ex)
            {
                Logger.LogError("SSConfigConnBLL", "Delete", AppError.EROR, 0, ex, "删除SSConfigConnBll信息出错。", 
                                String.Format("sSConfigID = {0}", sSConfigID));
                throw new SystemException(ErrorCodeDelete, ex);
            }
        }
      }
}